package com.hhkj.api.withdrawal.service.biz;

import com.github.pagehelper.PageInfo;
import com.hhkj.api.withdrawal.model.req.ApiWithdrawalCurrentDayCountRes;
import com.hhkj.api.withdrawal.model.req.ApiWithdrawalPagingReq;
import com.hhkj.api.withdrawal.model.req.ApiWithdrawalSaveReq;
import com.hhkj.api.withdrawal.model.res.ApiWithdrawalDetailRes;
import com.hhkj.api.withdrawal.model.res.ApiWithdrawalPagingRes;

import java.util.concurrent.TimeUnit;

/**
 * ApiSaleWithdrawalBizService
 *
 * @author zheng
 * @since 2023/11/7 0:47
 */
public interface ApiSaleWithdrawalBizService {

    Integer MAX_RETRY_COUNT = 3;

    Integer LOCK_TIME = 24;

    TimeUnit TIME_UNIT = TimeUnit.HOURS;

    String ACCOUNT_LOCK_TYPE = "withdrawal";

    /**
     * 新增提现
     *
     * @param req 请求信息
     * @return true/false
     */
    boolean save(ApiWithdrawalSaveReq req);

    /**
     * 统计当天体现==提现次数
     *
     * @return 体现次数
     */
    ApiWithdrawalCurrentDayCountRes countAmountCurrentDay();

    /**
     * 根据id获取详情
     *
     * @param id id
     * @return 提现详情
     */
    ApiWithdrawalDetailRes getById(Long id);

    /**
     * 提现功能分页
     *
     * @param req 请求信息
     * @return 分页信息
     */
    PageInfo<ApiWithdrawalPagingRes> paging(ApiWithdrawalPagingReq req);
}
